from connect_mongo import ConnectMongo
from fastapi import APIRouter

router = APIRouter(prefix="/api/v1", tags=[""])

if __name__ == '__main__':
    mongo1 = ConnectMongo("mongodb-svc.wjs.svc.cluster.local", "devmongo", "devmongo2023",
                          "wjs_cloud_course")
    #   mongo1 = connect_dataBase.ConnectMongo
    query = {
        "isDel": False
    }
    print(len(list(mongo1.demo(query, "classInfo"))))


@router.get("/base")
def test():
    mongo1 = ConnectMongo("mongodb-svc.wjs.svc.cluster.local", "devmongo", "devmongo2023",
                          "wjs_cloud_course")
    #   mongo1 = connect_dataBase.ConnectMongo
    query = {
        "isDel": False
    }
    return list(mongo1.demo(query, "classInfo"))
